import router from '../../router'
// import store from '../../store'
import localCache from '@/utils/localCache'

// 路由进入拦截
router.beforeEach((to, from, next) => {
  if (to.matched.some((r) => r.meta.requireAuth)) {
    if (localCache.getItem('token') !== 'null') {
      next()
    } else {
      next({
        path: '/'
      })
    }
  } else {
    next()
  }
})
